
<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?>
<title><?= $sf_response->getTitle() ?></title>
<?php use_stylesheet('/sf/sf_admin/css/main') ?>
<style type="text/css">
<!--
div.visible
{
overflow: visible;
float: none;
position: relative;
}
.style1 {
	font-size: 18px;	
        margin-top: 5px;
}
.style2 {
	font-size: 24px;
	font-weight: bold;
 
}
.style_no_border
  {
      border: 0px;
     
  }
 
   p.note{text-align:justify;
           line-height:120%;
           font-size: 13px;
           margin-top: 0px;
 
   } 
   p.note1
   { 
      font-style: italic;
      font-size: 13px;
   }
   
   tr.head
   {
      height: 25px;     
      color:green;
      font-size: 25px;
   }
   td.right
     {
         with:80%;
         color:blue;
    }
    table.bg
    { 
        
       height: 60px;
       padding-top: 0px;
       margin-top: -10px;
    }
    p.image
    {
        margin:10px;
    }
     p.image1
    {
        margin-top:-40px;
    }
    .widther
    {
        width:150px;
    }
    .signature
    {
      
        margin-top:-10px;
        height: 20px;
    }
    .tdsignature
    {
        border-top:  1px solid navy;
    }
    p.under
    {
        margin-top: -15px;
    }
    p.above
    {
         margin-top:0px;
    }
    table
    {
    border-collapse:collapse;
    }    
    P.breakhere {page-break-before: always}
    
    -->
   </style>
   <?
mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
mb_http_input('UTF-8');
mb_language('uni');
mb_regex_encoding('UTF-8');
ob_start('mb_output_handler');

?>
<div class="visible">
<table  class="bg" width="100%">
    <tr>
      <td class="right" width="60%" >
      <span class="style2">PURCHASE ORDER</span><br/>
      <span class="style1">Sunlight  Electrical (Vietnam) Co., Ltd.</span><br />
        20 Doc Lap ave. VSIP 1 Thuan An District, Binh Duong Province,VietNam.<br>
        Phone: (+84-650)3743 505 &nbsp  Fax: (+84-650)3743 508
      </td>
      <td>
          &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;  
      </td>
      <td width="30%">
		<span><p align="center" class="margin-top:10px" >
           <img border="0" src="<?php echo image_path("logo.png"); ?>" width="70%" height="70%">
       </p></span>
        <span><p align="center">www.sunlightgroup.com</p></span>
      </td>
    </tr>    
</table>
<br>

<table width="100%" style="margin-top:0px" >
  <tr class="head">
    <td>P.O NUMBER: <?echo $po->getPono()?></td>
  </tr>
  <tr>
    <td>The number must be on all related correspondence, shipping papers,and invoices:</td>
  </tr>
  <tr>
    <td><strong>Ref: </strong></td>
  </tr>
  <tr>
    <td><strong>MR: <? echo $mrno?></strong></td>
  </tr>  
  <tr>
    <td><strong>To</strong>:</td>
  </tr>
  <tr>
    <td><strong><?echo $supplier->getName()?></strong></td>
  </tr>
  <tr>
    <td><?echo $supplier->getAddress()?></td>
  </tr>
  <tr>
    <td><strong>Tel: <?echo $supplier->getPhone()?></strong></td>
  </tr>
  <tr>
    <td><strong>Fax: <?echo $supplier->getFax()?></strong></td>
  </tr>
  <tr>
    <td><strong>Attn: <?echo $supplier->getContactpersonname()?></strong></td>
  </tr>
</table>
<br>
<table width="100%" style="border:1px solid #D6D7D5;" cellpadding="1" cellspacing="0">
  <tr style="color:#C64934">
    <td style="border:1px solid #D6D7D5;" ><strong><font size="2">PURCHASER</font></strong></td>
    <td style="border:1px solid #D6D7D5;"><strong><font size="2">P.O. DATE 
	</font> </strong></td>
    <td style="border:1px solid #D6D7D5;"><strong><font size="2">DESTINATION POINT 
	</font> </strong></td>
    <td style="border:1px solid #D6D7D5;"><strong><font size="2">SHIPPED VIA 
	</font> </strong></td>
    <td style="border:1px solid #D6D7D5;"><strong><font size="2">PAYMENT TERM 
	</font> </strong></td>
  </tr>
  <tr>
    <td style="border:1px solid #D6D7D5;"><font size="2"><?echo $CreateName?>
	</font></td>
    <td style="border:1px solid #D6D7D5;"><font size="2"><?echo $po->getCreatedat('d/m/Y')?>
	</font></td>
    <td style="border:1px solid #D6D7D5;"><font size="2">At Site-SEV </font> </td>
    <td style="border:1px solid #D6D7D5;"><font size="2"><?echo CommonValues::$gPOShip['value'][$po->getShippedvia()]?></font></td>
    <td style="border:1px solid #D6D7D5;"><font size="2"><?echo $po->getPaymentterm()?>
	</font> </td>
  </tr>
  <tr>
      <td style="border:1px solid #D6D7D5;">
          <p class="above"><strong><font size="2">Consignee's Name and Address:</font></strong></p>
          <p class="under">&nbsp;</p>
      </td>
      <td style="border:1px solid #D6D7D5;" colspan="4">
          <p class="above"><em><font size="2">Sunlight Electrical Vietnam</font></em></p>
          <p class="under"><em><font size="2">20 Dai Lo Doc Lap, VSIP, Thuan An, Binh Duong, Vietnam</font> </em></p>
      </td>
  </tr>
  <tr>
       <td style="border:1px solid #D6D7D5;">
          <p class="above"><strong><font size="2">Contact Person:</font></strong></p>
      </td >
      <td style="border:1px solid #D6D7D5;" colspan="4">
         <font size="2">
         <?php echo $contactperson?>
      </font>
      </td>
  </tr>
   <tr>
       <td style="border:1px solid #D6D7D5;">
           <p class="above"><strong><font size="2">Notify party's Name and Address:</font></strong></p>
           <p class="under">&nbsp;</p>
      </td>
      <td style="border:1px solid #D6D7D5;" colspan="4">
        <p class="above"><em><font size="2">Sunlight Electrical Vietnam</font></em></p>
        <p class="under"><em><font size="2">20 Dai Lo Doc Lap, VSIP, Thuan An, Binh Duong, Vietnam</font> </em></p>
      </td>
  </tr>
   <tr >
       <td style="border:1px solid #D6D7D5;">
         <p class="above"><strong><font size="2">Invoicing Address:</font></strong></p>
         <p class="under">&nbsp;</p>
      </td>
      <td colspan="4" style="border:1px solid #D6D7D5;" >
        <p class="above"><em><font size="2">Sunlight Electrical Vietnam</font></em></p>
        <p class="under"><em><font size="2">20 Dai Lo Doc Lap, VSIP, Thuan An, Binh Duong, Vietnam</font> </em></p>
      </td>
  </tr>
  <tr>
       <td style="border:1px solid #D6D7D5;">
          <p><strong><font size="2">Other information:</font></strong></p>
          <p class="under"><font size="2">Product list</font></p>
          <p class="under"><font size="2">Total amount (<?echo $po->getCurrency()?>)</font></p>
          <p class="under"> <font size="2">Shipment  </font>  </p>
          <p class="under"><strong><font size="2">Required delivery date </font> </strong></p>
      </td>
      <td colspan="4" style="border:1px solid #D6D7D5;">
          <p >&nbsp;</p>
          <p class="under"><font size="2">See attached other list ( pages)</font></p>
          <p class="under"><font size="2"><?echo $po->getCurrency()=='USD'? '$':$po->getCurrency(); echo "  ". CommonValues::FormatCurrency($po->getTotalprice()); ?></font></p>
          <p class="under">&nbsp;</p>
          <p class="under"><strong><font size="2"><? echo $po->getExparrdate('d/m/Y')?></font> </strong></p>
          
      </td>
    </tr>  
    <td style="border:1px solid #D6D7D5;"><strong><font size="2">Additional Information 
	</font> </strong></td>
    <td style="border:1px solid #D6D7D5;" colspan="4">
      <p><font size="2">1. Please    send Invoice prior to/on delivery.</font></p>
      <p class="under"><font size="2">2. Enter this Order in    accordance with the prices, terms, delivery method, and    specifications listed above.</font></p>
      <p class="under"><font size="2">3. Please    notify us immediately if you are unable to deliver as&nbsp;specified. Late delivery    penalty will be born by the seller.</font></p>
      <p class="under"><font size="2">4. Supplier will be charged 1%    total amount of PO for 1day late.</font></p></td>
  </tr>
</table>

<p class="breakhere">

<p  align="center" class="style1">ORDER LIST</p>

<table class="under" width="100%" border="1" cellpadding="1" cellspacing="0">
  <tr style="color:#C64934">
    <td><p  align="center"><strong>No</strong></p></td>
    <td><p  align="center"><strong>DESCRIPTION</strong></p></td>
    <td><p  align="center"><strong>CODE</strong></p></td>
    <td><p  align="center"><strong>BRAND</strong></p></td>
    <td><p  align="center"><strong>QTY</strong></p></td>
    <td><p  align="center"><strong>UNIT</strong></p></td>
    <td><p  align="center"><strong>UNIT PRICE </strong></p></td>
    <td><p  align="center"><strong>TOTAL<br/>(<?echo $po->getCurrency()?>)</strong></p></td>
  </tr>
<? foreach ($compsList as $key=>$comps){
    $comp = ComponentPeer::retrieveByPK($comps->getComponentId());
?>
  <tr>
    <td><?echo $key+1?></td>
    <td><?echo $comp->getDescription()?></td>
    <td><?echo $comp->getProductcode()?></td>
    <td><?echo $comp->getBrand()?></td>
    <td><p align="right"><?echo CommonValues::FormatCurrency($comps->getQty1(), FALSE)?></td>
    <td><p align="right"><?echo $comp->getComponentunit()?></td>
    <td><p align="right"><?echo CommonValues::FormatCurrency($comps->getQty2())?></td>
    <td><p align="right"><?echo CommonValues::FormatCurrency($comps->getQty3())?></td>    
  </tr>
<?}
?>
  <tr>
    <td colspan="7" class="style_no_border"><p align="right"><strong>SUB TOTAL </strong></td>
    <td><p align="right"><?echo CommonValues::FormatCurrency( $po->getSubtotalprice());?></td>
  </tr>
  <tr>
    <td colspan="7" class="style_no_border"><p align="right">Value At Tax <?echo $po->getVat() ?>% </td>
    <td><p align="right"><?echo $po->getVat()? CommonValues::FormatCurrency( $po->getVat()*$po->getSubtotalprice()/100) : 0?></td>
  </tr>
  <tr>
    <td colspan="7"class=" style_no_border"><p align="right">Shipping and Handing </td>
    <td><p align="right"><?echo CommonValues::FormatCurrency( $po->getShipandhand());?></td>
  </tr>
  <tr>
    <td colspan="7" class="style_no_border"><p align="right">Others</td>
    <td><p align="right"><? echo CommonValues::FormatCurrency($po->getOther());?></td>
  </tr>
  <tr>
    <td colspan="7" class="style_no_border"><p align="right"><strong>TOTAL</strong></td>
    <td><p align="right"><? echo CommonValues::FormatCurrency($po->getTotalprice());?></td>
  </tr>
</table>

    <br/>
<table style="height:40px" width="100%" >
     <tr>
        <td  width="34%">
		 <hr width="50%" style="margin-left:0px;"/>
           Authorized signature   
       </td>    
       <td  width="33%">
		 <hr width="50%" style="margin-left:0px;"/>
         Authorized by
       </td>       
       <td  width="33%">
		  <hr width="50%" style="margin-left:0px;"/>
          Approved by 
       </td>
    </tr>
    <tr style="height:10px;">
        <td width="34%">
          <p class="note1">(Chữ ký có thẩm quyền)</p>
       </td>   
       <!--Authorized by -->
       <td width="33%">           
           <i><?php if ($HasApproved) echo $HOSName; else echo "NOT YET APPROVED"; ?></i><br/>
           <font size="2">Support Head
       </font>
       </td>
       <td width="33%">
           <i><?php if ($HasApproved) echo $GDName; else echo "NOT YET APPROVED"; ?></i><br/>
           <font size="2">General Director</font>
       </td>
    </tr>
     <tr>
        <td width="34%" >
           
       </td>
	   <td width="33%">
            Date : <? echo $HOSSignDate; ?>
       </td>
	   <td width="33%">
            Date : <? echo $GDSignDate; ?>
        </td>
    </tr>
    <tr>
        <td width="100%" colspan="3" align="center">
            <? if ($HasApproved)
           echo "THIS APPROVAL IS EXECUTED BY SUNLIGHT SYSTEM & OFFICIALLY ACCEPTED AS ELECTRONIC SIGNATURE BY BOD"; 
           ?>
       </td>    
    </tr>
</table>
</div>